package com.jye.rseven.user.mapper;

import com.jye.rseven.domain.Promotion;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface PromotionMapper {

    //根据id进行查询
    Promotion findPromotionById(@Param("id") int id);

    //查询被推广表所有数据
    List<Promotion> findAllPromotion(@Param("skip")int skip, @Param("limit")int limit);

    //根据订单id查出用户Id
    Integer findUserIdBypId(@Param("pId")int pId);

    //添加数据到被推广表
    void addPromotion(@Param("promotion")Promotion promotion);

    int updatePromotion(@Param("promotion")Promotion promotion);


    //查询状态
    String findPromotionStatusByuId(@Param("uid") int uId);

    //通过分享码进行查询
    Promotion findPromotionByShareCode(@Param("shareCode")String shareCode);

}
